.TH std::formattable 3 "2024.06.10" "http://cppreference.com" "C++ Standard Libary"
.SH NAME
std::formattable \- std::formattable

.SH Synopsis
   Defined in header <format>
   template< class T, class CharT >

   concept formattable = /* formattable_with */<
     std::remove_reference_t<T>,                                 \fB(1)\fP (since C++23)
     std::basic_format_context</* fmt_iter_for */<CharT>, CharT>

   >;
   Helper templates
   template< class CharT >                                       \fB(2)\fP (exposition only*)
   using /* fmt_iter_for */ = /* unspecified */;
   template< class T, class Context,

             class Formatter =
                 typename Context::template
                     formatter_type<std::remove_const_t<T>> >
   concept /* formattable_with */ =
     std::semiregular<Formatter> &&
     requires (Formatter& f, const Formatter& cf, T&& t, Context
   fc,                                                           \fB(3)\fP (exposition only*)
               std::basic_format_parse_context<
                   typename Context::char_type
               > pc) {
       { f.parse(pc) } -> std::same_as<typename
   decltype(pc)::iterator>;
       { cf.format(t, fc) } -> std::same_as<typename
   Context::iterator>;

     };

   The concept formattable specifies that std::formatter<std::remove_cvref_t<T>, CharT>
   meets the requirements of BasicFormatter and Formatter (if
   std::remove_reference_t<T> is const-qualified).

   The exposition-only alias template /* fmt_iter_for */ yields an unspecified type
   that satisfies std::output_iterator<const CharT&>.

   Defect reports

   The following behavior-changing defect reports were applied retroactively to
   previously published C++ standards.

      DR    Applied to              Behavior as published              Correct behavior
   LWG 3925 C++23      the second template argument of                 provided
                       std::basic_format_context was not provided

.SH See also

   formatter      defines formatting rules for a given type
   (C++20)        \fI(class template)\fP
   BasicFormatter abstracts formatting operations for a given formatting argument type
   (C++20)        and character type
                  (named requirement)
   Formatter      defines functions used by the formatting library
   (C++20)        (named requirement)
